import request from '../utils/request';

/*开始*/
export const toStart = param => {
    return request({
        url: '/api/bicycle/training/startTraining',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        data: param
    });
};
/*暂停*/
export const toPause = param => {
    return request({
        url: '/api/bicycle/training/pauseTraining',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*继续*/
export const toContinue = param => {
    return request({
        url: '/api/bicycle/training/resumeTraining',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*结束*/
export const toEnd = param => {
    return request({
        url: '/api/bicycle/training/stopTraining',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*发送速度*/
export const  toSpeed= param => {
    return request({
        url: '/api/bicycle/training/setSpeed',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*发送阻力*/
export const  toDrag= param => {
    return request({
        url: '/api/bicycle/training/setResistance',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*修改痉挛检测 5个*/
export const updSpasmLevel= param => {
    return request({
        url: '/api/bicycle/training/setSpasmLevel',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*修改运动方向 5个*/
export const setDirection= param => {
    return request({
        url: '/api/bicycle/training/setDirection',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*设置运动模式*/
export const setModeType= param => {
    return request({
        url: '/api/bicycle/training/switchRunModeType',
        method: 'post',
        // url:'./json/isLogin.json',
        // method: 'get',
        params: param
    });
};
/*获取训练所有数据*/
export const getAll= param => {
    return request({
        url: '/api/bicycle/training/selectTraining',
        method: 'post',
        // url:'./json/data.json',
        // method: 'get',
        params: param
    });
};

/*新增训练信息*/
export const doAdd= param => {
    return request({
        url: '/api/bicycle/training/doAdd',
        method: 'post',
        // url:'./json/setTrain.json',
        // method: 'get',
        data: param
    });
};



